package com.example.demo.entity;

import lombok.Data;
import javax.validation.constraints.*;
import java.util.Date;
import java.util.List;

@Data
public class Rule {
    private Integer id;

    @NotNull(message = "上级菜单ID不能为空")
    private Integer rule_id;

    @NotNull(message = "是否是菜单不能为空")
    @Min(value = 0, message = "是否是菜单只能是0或1")
    @Max(value = 1, message = "是否是菜单只能是0或1")
    private Integer menu;

    @NotBlank(message = "菜单名称不能为空")
    private String name;

    private String condition;

    private String method;

    @NotNull(message = "状态不能为空")
    @Min(value = 0, message = "状态只能是0或1")
    @Max(value = 1, message = "状态只能是0或1")
    private Integer status;

    @NotNull(message = "排序不能为空")
    @Min(value = 0, message = "排序不能小于0")
    private Integer order;

    private String icon;

    private String frontpath;

    private Date create_time;
    private Date update_time;

    private List<Rule> child;
}
